]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
BoxPointer: account for border width when requesting size
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 6 Oct 2013 21:32:51 +0000 (23:32 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 7 Oct 2013 18:18:48 +0000 (20:18 +0200)
We must reduce the forWidth in the call to get_preferred_height()
with the border width, otherwise we might request a smaller height
that we actually need and overflow.

https://bugzilla.gnome.org/show_bug.cgi?id=696564

js/ui/boxpointer.js

index 80dd11de9303f69c844a0a0d17d12810f07882a7..c8a15d3f9251d61f79f458de6db94e22ce341ff8 100644 (file)
@@ -185,7 +185,9 @@ const BoxPointer = new Lang.Class({
     },
 
     _getPreferredHeight: function(actor, forWidth, alloc) {
-        let [minSize, naturalSize] = this.bin.get_preferred_height(forWidth);
+        let themeNode = this.actor.get_theme_node();
+        let borderWidth = themeNode.get_length('-arrow-border-width');
+        let [minSize, naturalSize] = this.bin.get_preferred_height(forWidth - 2 * borderWidth);
         alloc.min_size = minSize;
         alloc.natural_size = naturalSize;
         this._adjustAllocationForArrow(false, alloc);